﻿using System;
using System.Collections.Generic;
using ZyGames.DZPocker.Model;
using ZyGames.Framework.Cache.Generic;
using ZyGames.Framework.Game.Cache;
using ZyGames.Framework.Game.Context;
using ZyGames.Framework.Game.Contract;
using ZyGames.Framework.Game.Contract.Action;
using ZyGames.Framework.Game.Lang;
using ZyGames.Framework.Game.Service;
using System.Linq;
using ZyGames.DZPocker.Bll.Logic;
using ZyGames.DZPocker.Script;

namespace ZyGames.DZPocker.Script.CsScript.Action
{
	/// <summary>
	/// 广播轮到某个玩家开始下注
	/// 下注的最小范围,下注的类型(看牌还是弃牌)
	/// </summary>
	public class Action30006 : BaseAction
	{
		private int _tableId;
		private int _posId;
		private int _userId;
		/// <summary>
		/// 最小下注
		/// </summary>
		private int _minChip;
		/// <summary>
		/// 1.跟注 2.AllIn 4.看牌
		/// </summary>
		private int _betType = 0;
		/// <summary>
		/// 操作倒计时
		/// </summary>
		private int _time;


		public Action30006(HttpGet actionGetter)
			: base((short)ActionType.DZBrocastPlayBeginBet, actionGetter)
		{
		}
		public override bool GetUrlElement()
		{
			if (httpGet.GetInt("TableID", ref _tableId) &&
				httpGet.GetInt("UserID", ref _userId) &&
				httpGet.GetInt("PosID", ref _posId) &&
				httpGet.GetInt("BetType", ref _betType) &&
				httpGet.GetInt("MinChip", ref _minChip) &&
				httpGet.GetInt("Time",ref _time))
			{
				return true;
			}
			return false;
		}

		public override bool TakeAction()
		{
			return true;
		}

		public override void BuildPacket()
		{
			this.PushIntoStack(_tableId);
			this.PushIntoStack(_userId);
			this.PushIntoStack(_posId);
			this.PushIntoStack(_betType);
			this.PushIntoStack(_minChip);
			this.PushIntoStack(_time);
		}
	}
}
